doctype 5
html
  head
    title= content_for(:title)
    = auto_discovery_link_tag :atom, projects_url(format: :atom)
    = auto_discovery_link_tag :rss, projects_url(format: :rss)
    = stylesheet_link_tag 'catarse_bootstrap/fonts'
    = stylesheet_link_tag 'catarse_bootstrap/catarse'
    = stylesheet_link_tag '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css'
    = content_for(:stylesheets)
    = favicon_link_tag 'favicon.ico'
    = csrf_meta_tag
    meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"
    meta#api-host name="api-host" content=CatarseSettings[:api_host]

    - if content_for? :meta_tags
      /project specific meta tags
      = yield :meta_tags
    - else
      /meta tags for the whole site
      meta name="description"         content=t('site.description')
      meta name="keywords"            content=t('site.keywords')
      meta name="google-site-verification"  content=CatarseSettings[:google_verification_code]
      
      meta property="og:title"        content=t('site.title')
      meta property="og:type"         content=:cause
      meta property="og:url"          content=root_url
      meta property="og:image"        content=CatarseSettings[:company_logo]
      meta property="og:site_name"    content=CatarseSettings[:company_name]
      meta property="fb:app_id"       content=CatarseSettings[:facebook_app_id]
      meta property="og:description"  content=(t('projects.index_header.title') + '. ' +  t('projects.index_header.subtitle'))
      /Call VWO on header to prevent flash of unmodified content on variation tests 
    - if request.subdomain.include? "beta"
      meta name="robots" content="noindex, nofollow"
      
    - if Rails.env.production?
      = render 'layouts/vwo'
      = render_mixpanel_script

  body#catarse_bootstrap[data-controller-name=controller_name data-action=action_name data-user="#{current_user.try(:to_analytics_json)}" data-referral="#{session[:referral_link]}" data-id=params[:id] data-mobile=browser.mobile?.to_s itemscope itemtype="http://schema.org/WebPage" class="#{'body-alert' if can_display_pending_refund_alert?} #{content_for :body_class}"] 
    /= render 'layouts/global_alert'
    = render 'layouts/pending_refund_top_alert' if can_display_pending_refund_alert?
    = render 'layouts/new_zendesk'
    = render_facebook_sdk
    = render 'layouts/flash' if notice.present?
    = yield

  - if content_for? :application_js
    = yield :application_js
  - else
    = javascript_include_tag :application

  - if content_for? :js
    /page specific JS files
    = yield :js
  - if Rails.env.production?
    = render 'layouts/hotjar'
    = render_google_analytics_script
